<?php 
$orderTicket = OrderTickets::model()->findByAttributes(array('order_id'=>$model->id));

if($orderTicket->price == '0.00' || $orderTicket->price == 0){
    $this->renderPartial('orderSuccess2',array('model'=>$model), false, true);
}else{
    $this->renderPartial('orderSuccess1',array('model'=>$model), false, true);    
}
 ?>
<?php if ($model->status === 'D') : ?>
<script type="text/javascript">
$(document).ready(function(){
   $('#orderModal').modal('show');
});
</script>
<!-- Modal -->
<div class="modal fade" id="orderModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                 <h4 class="modal-title">Cảm ơn quý khách đã đặt vé</h4>
            </div>
            <div class="modal-body">
                <p><strong>Thông tin đặt vé đã được ghi nhận. Chúng tôi sẽ xử lý trong thời gian sớm nhất.</strong></p>
            </div>
            <div class="modal-footer">
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<?php $model->updateByPk($model->id, array('status'=>'P')) ?>
<?php endif; ?>